public class BluetoothPort extends GpPort
mClosePort, mHandler, mmBytesAvailable, mPrinterId, mState
构造器和说明 |
---|
BluetoothPort(int id,
android.bluetooth.BluetoothDevice device,
android.os.Handler handler)
Constructor.
|
限定符和类型 | 方法和说明 |
---|---|
void |
connect()
Start the ConnectThread to initiate a connection to a remote device.
|
void |
connected(android.bluetooth.BluetoothSocket socket,
android.bluetooth.BluetoothDevice device)
Start the ConnectedThread to begin managing a Bluetooth connection
|
void |
stop()
Stop all threads
|
GpCom.ERROR_CODE |
writeDataImmediately(java.util.Vector<java.lang.Byte> data) |
closePortFailed, connectionFailed, connectionLost, connectionToPrinterFailed, getState, invalidPrinter, setState
public BluetoothPort(int id, android.bluetooth.BluetoothDevice device, android.os.Handler handler)
context
- The UI Activity Contexthandler
- A Handler to send messages back to the UI Activitypublic void connect()
device
- The BluetoothDevice to connectpublic void connected(android.bluetooth.BluetoothSocket socket, android.bluetooth.BluetoothDevice device)
socket
- The BluetoothSocket on which the connection was madedevice
- The BluetoothDevice that has been connectedpublic void stop()
public GpCom.ERROR_CODE writeDataImmediately(java.util.Vector<java.lang.Byte> data)